﻿@model List<sBlog.Net.Domain.Entities.PostEntity>
<div id="section1" class="menu" style="background-color: #f0efef;">
    <div style="float: left; background-color: #f0efef; height: 30px; margin-top: 5px;">
        <img src="@Url.Content("~/Content/Images/MlogThem/mlog-quote-icon.png")" width="22" height="15" alt="blash"/>&nbsp;&nbsp;
    </div>
    <h2>
        các nội dung hay trên mlog</h2>
    <div style="clear: both;">
    </div>
    <ul class="ulBackground">
        @foreach (var post in Model)
        {
            <li>
                @{
            var url = Url.RouteUrl("IndividualPost", new { year = post.PostYear, month = post.PostMonth, url = post.PostUrl, status = string.Empty });
            var shortTitle = post.PostTitle.Length > 60 ? string.Format("{0}...", post.PostTitle.Substring(0, 60)) : post.PostTitle;

            var avatar = string.Empty;
            if (post.PostAvatarSquare == string.Empty || post.PostAvatarSquare == null || post.PostAvatarSquare.Trim() == "" || post.PostAvatarSquare.Trim() == string.Empty)
            {
                avatar = post.PostAvatar;
            }
            else
            {
                avatar = post.PostAvatarSquare;
            }            
                }
                <div class="postMostView">
                    <div style="padding-left: 10px; float: left;">
                        <a href="@url">
                            <img src="@Url.Content("http://s1.img.yan.vn/Mlog/UploadThumbs/80x80_" + @avatar)" style="border: none 0;" alt="avatar"/></a>
                    </div>
                    <div class="textRight">
                        <a href="@url" title="@post.PostTitle">@shortTitle</a>
                        <br />
                        <div class="boxAuthorViewLike" style="border: 0 none !important;">
                            <span class="posted" style="float: left;">
                                <img src="@Url.Content("~/Content/Images/MlogThem/IconView.png")" width="17" height="12" alt="View count"/>&nbsp;@Convert.ToInt32(@post.ViewCount).ToString("#,##0")
                                &nbsp;
                                <img src="@Url.Content("~/Content/Images/MlogThem/heart-follow.png")" width="12" height="12" alt="like count"/>&nbsp;@Convert.ToInt32(@post.LikeCount).ToString("#,##0")
                            </span>
                        </div>
                    </div>
                </div>
            </li>
        }
    </ul>
</div>
